# -*- coding: UTF-8 -*-

numbers = [1, 3, 5, 0, 1, 2, 4, 4, 0, 3, 2, 5, 3]

print("排序前：", numbers)

# 找出数据最大值
maxNum = numbers[0]
for num in numbers:
    if num > maxNum:
        maxNum = num

# 声明统计数组
counters = [0] * (maxNum + 1)

# 开始计数
for num in numbers:
    counters[num] += 1

# 统计完毕，展开数组
sortIndex = 0
for num in range(maxNum + 1):
    while counters[num] > 0:
        numbers[sortIndex] = num
        sortIndex += 1
        counters[num] -= 1

print("排序后：", numbers)
